package org.fastmvc.resource.location.impl;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import java.util.regex.Pattern;

import org.fastmvc.resource.FastMvcResource;
import org.fastmvc.resource.location.ResourceLocation;

/**
 * <类描述>
 *
 * @author tangch
 * @date 2017年11月08日 9:48
 */
public class JarResourceLocation extends ResourceLocation {

	protected URL url;

	public JarResourceLocation(URL url) {
		this.url = url;
	}

	@Override
	public String getId() {
		return url.toString();
	}

	@Override
	public void scan(String base, Pattern pattern, List<FastMvcResource> list) {

	}

	public JarResourceLocation(String jarPath) throws IOException {
		this(new File(jarPath).toURI().toURL());
	}
}
